Crate saturating

Source
Expand description

Provides Saturating<T>, an intentionally-saturating arithmetic wrapper, similar to [std::num::Wrapping].

§Examples

use saturating::Saturating;

let foo = Saturating(253u8);
let bar = Saturating(100u8);

assert_eq!(std::u8::MAX, (foo + bar).0);

Structs§

  • Provides intentionally-saturating arithmetic on T.